package com.itheima.admin.controller;

import com.itheima.admin.dto.ApSensitivePageRequestDto;
import com.itheima.admin.pojo.AdSensitive;
import com.itheima.admin.service.AdSensitiveService;
import com.itheima.common.vo.PageResultVo;
import com.itheima.core.controller.AbstractCoreController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sensitive")
@Api(tags = "敏感词汇管理")
public class AdSensitiveController extends AbstractCoreController<AdSensitive> {


    private AdSensitiveService adSensitiveService;

    @Autowired
    public AdSensitiveController(AdSensitiveService adSensitiveService) {
        super(adSensitiveService);
        this.adSensitiveService = adSensitiveService;
    }

    @PostMapping("/list")
    @ApiOperation("用户分页搜索")
    public PageResultVo<AdSensitive> page(@RequestBody ApSensitivePageRequestDto dto){
        return adSensitiveService.pageList(dto);
    }
}
